#ifndef EI_GUI_H
#define EI_GUI_H

#include <list>
#include <Ogre.h>
#include <OgreEventListeners.h>
#include <OgreKeyEvent.h>

#include <CEGUI/CEGUI.h>
#include "include/OgreCEGUIRenderer.h"
#include "include/OgreCEGUIResourceProvider.h"
#include "include/GuiEvents.h"
#include <tinyxml.h>

using namespace Ogre;

namespace Ei {
	
class Gui : public FrameListener, public KeyListener, public MouseMotionListener, public MouseListener
{ 	
private:
 
  CEGUI::System* mGUISystem;
  CEGUI::Window* mEditorGuiSheet;
  CEGUI::Renderer* mGUIRenderer; 

  // Event handelers
  void mouseMoved(MouseEvent *e);
  void mouseDragged (MouseEvent *e); 
  void mousePressed (MouseEvent *e);
  void mouseReleased (MouseEvent *e);
  void mouseClicked(MouseEvent* e) {}
  void mouseEntered(MouseEvent* e) {}
  void mouseExited(MouseEvent* e) {}
  void keyPressed(KeyEvent* e);
  void keyReleased(KeyEvent* e);
  void keyClicked(KeyEvent* e) ;
  
  // events like mouse move and key pressed	
  EventProcessor* mEventProcessor; 
  
  bool frameStarted(const FrameEvent& evt);
  bool frameEnded(const FrameEvent& evt);
   	
  GuiEvents* mGuiEvents;
    
public:
  
  Gui(Ogre::SceneManager* manager, RenderWindow* window);
  ~Gui(); 
  void init();
  void show(bool toggle);
  
  EventProcessor* getEventProcessor(){return mEventProcessor;}
  // Sliders, and settings
  CEGUI::Scrollbar* mAccFilterBar;
  CEGUI::Scrollbar* mAccInterStepBar;
  CEGUI::Scrollbar* mAccInterAmountBar;
  // kalman filters
  CEGUI::Scrollbar* mdt;
  CEGUI::Scrollbar* mV_GAMMA;
  CEGUI::Scrollbar* mV_NOISE;
  CEGUI::Scrollbar* mOBS_NOISE;
  
  CEGUI::Window* mValues;

  CEGUI::RadioButton* mTuneAcc;
  CEGUI::RadioButton* mTuneMag;
  CEGUI::RadioButton* mTuneMagMove;
  /*CEGUI::RadioButton* mPauseSample;
  CEGUI::RadioButton* mPlaySample;
  CEGUI::Window* mSampleWindow;
  CEGUI::Window* mPositionWindow;
  */
 

   
};

}// end namespace
#endif // EI_GUI_H
